Integrand size = 31, antiderivative size = 83 \[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))} \, dx=-\frac {2 d \text {arctanh}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{a (c-d)^{3/2} \sqrt {c+d} f}+\frac {\tan (e+f x)}{(c-d) f (a+a \sec (e+f x))} \]
[Out]
Time = 0.20 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.61, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {4072, 98, 95, 211} \[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))} \, dx=\frac {2 d \tan (e+f x) \arctan \left (\frac {\sqrt {c+d} \sqrt {a \sec (e+f x)+a}}{\sqrt {c-d} \sqrt {a-a \sec (e+f x)}}\right )}{f (c-d)^{3/2} \sqrt {c+d} \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}+\frac {\tan (e+f x)}{f (c-d) (a \sec (e+f x)+a)} \]
[In]
[Out]
Rule 95
Rule 98
Rule 211
Rule 4072
Rubi steps \begin{align*} \text {integral}& = -\frac {\left (a^2 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a-a x} (a+a x)^{3/2} (c+d x)} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {\tan (e+f x)}{(c-d) f (a+a \sec (e+f x))}+\frac {(a d \tan (e+f x)) \text {Subst}\left (\int \frac {1}{\sqrt {a-a x} \sqrt {a+a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{(c-d) f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {\tan (e+f x)}{(c-d) f (a+a \sec (e+f x))}+\frac {(2 a d \tan (e+f x)) \text {Subst}\left (\int \frac {1}{a c-a d-(-a c-a d) x^2} \, dx,x,\frac {\sqrt {a+a \sec (e+f x)}}{\sqrt {a-a \sec (e+f x)}}\right )}{(c-d) f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {\tan (e+f x)}{(c-d) f (a+a \sec (e+f x))}+\frac {2 d \arctan \left (\frac {\sqrt {c+d} \sqrt {a+a \sec (e+f x)}}{\sqrt {c-d} \sqrt {a-a \sec (e+f x)}}\right ) \tan (e+f x)}{(c-d)^{3/2} \sqrt {c+d} f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ \end{align*}
Result contains complex when optimal does not.
Time = 1.06 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.93 \[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))} \, dx=\frac {2 \cos \left (\frac {1}{2} (e+f x)\right ) \left (\frac {2 d \arctan \left (\frac {(i \cos (e)+\sin (e)) \left (c \sin (e)+(-d+c \cos (e)) \tan \left (\frac {f x}{2}\right )\right )}{\sqrt {c^2-d^2} \sqrt {(\cos (e)-i \sin (e))^2}}\right ) \cos \left (\frac {1}{2} (e+f x)\right ) (i \cos (e)+\sin (e))}{\sqrt {c^2-d^2} \sqrt {(\cos (e)-i \sin (e))^2}}+\sec \left (\frac {e}{2}\right ) \sin \left (\frac {f x}{2}\right )\right )}{a (c-d) f (1+\cos (e+f x))} \]
[In]
[Out]
Time = 0.70 (sec) , antiderivative size = 74, normalized size of antiderivative = 0.89
method | result | size |
derivativedivides | \(\frac {\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{c -d}-\frac {2 d \,\operatorname {arctanh}\left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{\left (c -d \right ) \sqrt {\left (c +d \right ) \left (c -d \right )}}}{f a}\) | \(74\) |
default | \(\frac {\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{c -d}-\frac {2 d \,\operatorname {arctanh}\left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{\left (c -d \right ) \sqrt {\left (c +d \right ) \left (c -d \right )}}}{f a}\) | \(74\) |
risch | \(\frac {2 i}{f a \left (c -d \right ) \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}+\frac {d \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i c^{2}+i d^{2}+\sqrt {c^{2}-d^{2}}\, d}{c \sqrt {c^{2}-d^{2}}}\right )}{\sqrt {c^{2}-d^{2}}\, \left (c -d \right ) f a}-\frac {d \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c^{2}-i d^{2}+\sqrt {c^{2}-d^{2}}\, d}{\sqrt {c^{2}-d^{2}}\, c}\right )}{\sqrt {c^{2}-d^{2}}\, \left (c -d \right ) f a}\) | \(188\) |
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 353, normalized size of antiderivative = 4.25 \[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))} \, dx=\left [-\frac {\sqrt {c^{2} - d^{2}} {\left (d \cos \left (f x + e\right ) + d\right )} \log \left (\frac {2 \, c d \cos \left (f x + e\right ) - {\left (c^{2} - 2 \, d^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, \sqrt {c^{2} - d^{2}} {\left (d \cos \left (f x + e\right ) + c\right )} \sin \left (f x + e\right ) + 2 \, c^{2} - d^{2}}{c^{2} \cos \left (f x + e\right )^{2} + 2 \, c d \cos \left (f x + e\right ) + d^{2}}\right ) - 2 \, {\left (c^{2} - d^{2}\right )} \sin \left (f x + e\right )}{2 \, {\left ({\left (a c^{3} - a c^{2} d - a c d^{2} + a d^{3}\right )} f \cos \left (f x + e\right ) + {\left (a c^{3} - a c^{2} d - a c d^{2} + a d^{3}\right )} f\right )}}, -\frac {\sqrt {-c^{2} + d^{2}} {\left (d \cos \left (f x + e\right ) + d\right )} \arctan \left (-\frac {\sqrt {-c^{2} + d^{2}} {\left (d \cos \left (f x + e\right ) + c\right )}}{{\left (c^{2} - d^{2}\right )} \sin \left (f x + e\right )}\right ) - {\left (c^{2} - d^{2}\right )} \sin \left (f x + e\right )}{{\left (a c^{3} - a c^{2} d - a c d^{2} + a d^{3}\right )} f \cos \left (f x + e\right ) + {\left (a c^{3} - a c^{2} d - a c d^{2} + a d^{3}\right )} f}\right ] \]
[In]
[Out]
\[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))} \, dx=\frac {\int \frac {\sec {\left (e + f x \right )}}{c \sec {\left (e + f x \right )} + c + d \sec ^{2}{\left (e + f x \right )} + d \sec {\left (e + f x \right )}}\, dx}{a} \]
[In]
[Out]
Exception generated. \[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.33 \[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))} \, dx=\frac {\frac {2 \, {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, c - 2 \, d\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-c^{2} + d^{2}}}\right )\right )} d}{{\left (a c - a d\right )} \sqrt {-c^{2} + d^{2}}} + \frac {\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{a c - a d}}{f} \]
[In]
[Out]
Time = 13.58 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.33 \[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))} \, dx=\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{a\,f\,\left (c-d\right )}-\frac {2\,d\,\mathrm {atanh}\left (\frac {\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,c^2-2\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,c\,d+\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,d^2}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {c+d}\,{\left (c-d\right )}^{3/2}}\right )}{a\,f\,\sqrt {c+d}\,{\left (c-d\right )}^{3/2}} \]
[In]
[Out]